New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jest/expect-utils

Package Overview
Dependencies
Maintainers
6
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jest/expect-utils

This module exports some utils for the `expect` function used in [Jest](https://jestjs.io/).

28.1.3
Source
npm
Version published
Maintainers
6
Created

What is @jest/expect-utils?

@jest/expect-utils is a utility package for Jest that provides additional matchers and utilities to enhance the testing experience. It is designed to work seamlessly with Jest's built-in expect function, allowing for more expressive and readable test assertions.

What are @jest/expect-utils's main functionalities?

toBeArray

Checks if the value is an array.

expect([1, 2, 3]).toBeArray();

toBeObject

Checks if the value is an object.

expect({ key: 'value' }).toBeObject();

toBeEmpty

Checks if the value is empty. This can be used for arrays, objects, or strings.

expect([]).toBeEmpty();

toContainKey

Checks if the object contains the specified key.

expect({ key: 'value' }).toContainKey('key');

toContainValue

Checks if the object contains the specified value.

expect({ key: 'value' }).toContainValue('value');

Other packages similar to @jest/expect-utils

FAQs

Package last updated on 13 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts